#ifndef DLGMAIN_H
#define DLGMAIN_H

#include <QDialog>
#include <QTimer>
#include <QNetworkInterface>
#include <QSettings>
#include <QProcess>
#include <QSystemTrayIcon>
#include "tmmysqlctrl.h"

#define INI_PATH "./Config/NetPipe.ini"

namespace Ui {
class DlgMain;
}

class DlgMain : public QDialog
{
    Q_OBJECT

public:
    explicit DlgMain(QWidget *parent = 0);
    ~DlgMain();

    void init();

    QString getHostMacAddress();

    void showLog(QString strLog);

public slots:
    void slot_finished(int exitCode);
    void slot_start_netpipe();

    void trayicon_activated(QSystemTrayIcon::ActivationReason reason);

    void on_btn_hide_clicked();

    void on_btn_exit_clicked();

private:
    Ui::DlgMain *ui;

    QSystemTrayIcon* m_pSystemTray;

    QString strRootDir;
    QString m_strServerIp;
    int nServerPort;

    TMMySQLCtrl *pMySqlCtrl;
    QTimer *m_prTimer;
    QSettings *pr_setting;
    QProcess* m_pProcCmd;
    bool m_bIsStart;
    bool m_bConnect;
};

#endif // DLGMAIN_H
